//电子邮件puhalskijsemen@gmail.com
//源码网站 开vpn全局模式打开 http://web3incubators.com/
//电报https://t.me/gamecode999
var t = require;
var e = module;
var o = exports;
var n =
        (this && this.__extends) ||
        (function () {
            var t = function (e, o) {
                return (t =
                    Object.setPrototypeOf ||
                    ({__proto__: []} instanceof Array &&
                        function (t, e) {
                            t.__proto__ = e;
                        }) ||
                    function (t, e) {
                        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    })(e, o);
            };
            return function (e, o) {
                function n() {
                    this.constructor = e;
                }
                t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
            };
        })(),
    r =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var r,
                a = arguments.length,
                i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
            return a > 3 && i && Object.defineProperty(e, o, i), i;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var a = t("ConfS"),
    i = t("Platforms"),
    s = cc._decorator,
    c = s.ccclass,
    l =
        (s.property,
        (function (t) {
            function e() {
                return (null !== t && t.apply(this, arguments)) || this;
            }
            return (
                n(e, t),
                (e.prototype.init = function () {
                    this.refresh();
                }),
                (e.prototype.update = function () {
                    var t = i.default.userStorage.getItem("视频券");
                    if (
                        ((this.old视频券 == t && this.oldCDSec == i.default.userStorage.看视频CDSec) ||
                            ((this.old视频券 = t), (this.oldCDSec = i.default.userStorage.看视频CDSec), this.refresh()),
                        t > 0)
                    );
                    else if (i.default.userStorage.看视频CDSec > 0) {
                        var e =
                            a.DatasManager.看视频CD -
                            (Math.ceil(new Date().getTime() / 1e3) - i.default.userStorage.看视频CDSec);
                        e > 0
                            ? (this.cd.string = e.toString())
                            : ((i.default.userStorage.看视频CDSec = 0), i.default.userStorage.setDirty());
                    }
                }),
                (e.prototype.refresh = function () {
                    this.视频 ||
                        ((this.视频 = this.node.getChildByName("视频")),
                        (this.视频券 = this.node.getChildByName("视频券")),
                        (this.num = this.视频券.getChildByName("num").getComponent(cc.Label)),
                        (this.cd = this.node.getChildByName("cd").getComponent(cc.Label)));
                    var t = i.default.userStorage.getItem("视频券");
                    t > 0
                        ? ((this.视频.active = !1),
                          (this.视频券.active = !0),
                          (this.cd.node.active = !1),
                          (this.num.string = t + "/1"))
                        : i.default.userStorage.看视频CDSec > 0
                        ? ((this.视频.active = !1), (this.视频券.active = !1), (this.cd.node.active = !0))
                        : ((this.视频.active = !0), (this.视频券.active = !1), (this.cd.node.active = !1));
                }),
                (e = r([c], e))
            );
        })(cc.Component));
o.default = l;
